package test;



import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputMethodEvent;
import java.awt.event.InputMethodListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.WindowConstants;
import org.netbeans.lib.awtextra.AbsoluteConstraints;
import org.netbeans.lib.awtextra.AbsoluteLayout;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ProjectDialogSampel.java
 *
 * Created on Feb 15, 2009, 8:32:01 PM
 */

/**
 *
 * @author DMC
 */
public class ProjectDialogSampel extends javax.swing.JFrame {

    /** Creates new form ProjectDialogSampel */
    public ProjectDialogSampel() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabelPN = new JLabel();
        jLabelPL = new JLabel();
        jLabelPF = new JLabel();
        jLabelCreate = new JLabel();
        jLabelMW = new JLabel();
        jLabelMH = new JLabel();
        jLabelTW = new JLabel();
        jLabelTH = new JLabel();
        jTextFieldPN = new JTextField();
        jTextFieldPL = new JTextField();
        jTextFieldPF = new JTextField();
        jTextFieldMapWidth = new JTextField();
        jTextFieldMapHeight = new JTextField();
        jTextFieldTileWidth = new JTextField();
        jTextFieldTileHeight = new JTextField();
        Browse = new JButton();
        Cancel = new JButton();
        Create = new JButton();
        jLabelBackgrond = new JLabel();

        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        setMinimumSize(new Dimension(513, 326));
        getContentPane().setLayout(new AbsoluteLayout());

        jLabelPN.setText("Project Name:");
        getContentPane().add(jLabelPN, new AbsoluteConstraints(10, 60, -1, -1));

        jLabelPL.setText("Project Location:");
        getContentPane().add(jLabelPL, new AbsoluteConstraints(10, 90, -1, -1));

        jLabelPF.setText("Project Folder:");
        getContentPane().add(jLabelPF, new AbsoluteConstraints(10, 120, -1, -1));

        jLabelCreate.setText("Create New Project...");
        getContentPane().add(jLabelCreate, new AbsoluteConstraints(10, 10, -1, -1));

        jLabelMW.setText("Map Width:");
        getContentPane().add(jLabelMW, new AbsoluteConstraints(110, 160, -1, -1));

        jLabelMH.setText("Map Height:");
        getContentPane().add(jLabelMH, new AbsoluteConstraints(110, 190, -1, -1));

        jLabelTW.setText("Tile Width:");
        getContentPane().add(jLabelTW, new AbsoluteConstraints(280, 160, -1, -1));

        jLabelTH.setText("Tile Height:");
        getContentPane().add(jLabelTH, new AbsoluteConstraints(280, 190, -1, -1));

        jTextFieldPN.addKeyListener(new KeyAdapter() {
            public void keyReleased(KeyEvent evt) {
                jTextFieldPNKeyReleased(evt);
            }
        });
        getContentPane().add(jTextFieldPN, new AbsoluteConstraints(110, 60, 380, -1));
        getContentPane().add(jTextFieldPL, new AbsoluteConstraints(110, 90, 300, -1));
        getContentPane().add(jTextFieldPF, new AbsoluteConstraints(110, 120, 380, -1));
        getContentPane().add(jTextFieldMapWidth, new AbsoluteConstraints(180, 160, 60, -1));
        getContentPane().add(jTextFieldMapHeight, new AbsoluteConstraints(180, 190, 60, -1));
        getContentPane().add(jTextFieldTileWidth, new AbsoluteConstraints(350, 160, 60, -1));
        getContentPane().add(jTextFieldTileHeight, new AbsoluteConstraints(350, 190, 60, -1));

        Browse.setText("Browse");
        Browse.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                BrowseActionPerformed(evt);
            }
        });
        getContentPane().add(Browse, new AbsoluteConstraints(420, 90, -1, -1));

        Cancel.setText("Cancel");
        getContentPane().add(Cancel, new AbsoluteConstraints(420, 240, -1, -1));

        Create.setText("Create");
        getContentPane().add(Create, new AbsoluteConstraints(350, 240, -1, -1));

        jLabelBackgrond.setIcon(new ImageIcon(getClass().getResource("/com/images/ProjectDialogBackground.png"))); // NOI18N
        getContentPane().add(jLabelBackgrond, new AbsoluteConstraints(0, 0, -1, 300));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void BrowseActionPerformed(ActionEvent evt) {//GEN-FIRST:event_BrowseActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_BrowseActionPerformed

    private void jTextFieldPNKeyReleased(KeyEvent evt) {//GEN-FIRST:event_jTextFieldPNKeyReleased
        // TODO add your handling code here:
        System.out.println(jTextFieldPN.getText());
    }//GEN-LAST:event_jTextFieldPNKeyReleased

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
          try {
			UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InstantiationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (UnsupportedLookAndFeelException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        JFrame.setDefaultLookAndFeelDecorated(true);
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new ProjectDialogSampel().setVisible(true);
            }
        });
    }

    private ImageIcon iBackgroundDialog=new ImageIcon("abc.png");
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private JButton Browse;
    private JButton Cancel;
    private JButton Create;
    private JLabel jLabelBackgrond;
    private JLabel jLabelCreate;
    private JLabel jLabelMH;
    private JLabel jLabelMW;
    private JLabel jLabelPF;
    private JLabel jLabelPL;
    private JLabel jLabelPN;
    private JLabel jLabelTH;
    private JLabel jLabelTW;
    private JTextField jTextFieldMapHeight;
    private JTextField jTextFieldMapWidth;
    private JTextField jTextFieldPF;
    private JTextField jTextFieldPL;
    private JTextField jTextFieldPN;
    private JTextField jTextFieldTileHeight;
    private JTextField jTextFieldTileWidth;
    // End of variables declaration//GEN-END:variables

}
